# Maintainer:
# Contributor: Tom Gundersen <teg@jklm.no>
# Contributor: Ionut Biru <ibiru@archlinux.org>
# Contributor: Gabriel Martinez < reitaka at gmail dot com >

pkgname=libplist
pkgver=2.3.0
pkgrel=1
pkgdesc="A library to handle Apple Property List format whereas it's binary or XML"
url="https://libimobiledevice.org/"
arch=('x86_64')
license=('GPL2' 'LGPL2.1')
depends=('gcc-libs')
makedepends=('python' 'cython' 'autoconf-archive' 'python-setuptools')
optdepends=('python: for the Python bindings')
source=(https://github.com/libimobiledevice/libplist/releases/download/$pkgver/$pkgname-$pkgver.tar.bz2)
sha256sums=('4e8580d3f39d3dfa13cefab1a13f39ea85c4b0202e9305c5c8f63818182cac61')

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

check() {    
  cd $pkgname-$pkgver
  make check  
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install
  install -D -m644 cython/plist.pxd "${pkgdir}"/usr/include/plist/cython/plist.pxd
}
